package com.wangyi.activity;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.widget.Button;

import com.wangyi.common.CommonActivity;

public class ApplicationSetActivity extends CommonActivity {
	private Button account_manager_btn;
	private Button suggestion_btn;
	private Button update_btn;
	private Button about_btn;
	private Intent intent;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_applicationset);
		intent = getIntent();
		account_manager_btn = (Button) findViewById(R.id.account_manager_btn);
		account_manager_btn.setOnClickListener(this);
		suggestion_btn = (Button) findViewById(R.id.suggestion_btn);
		suggestion_btn.setOnClickListener(this);
		update_btn = (Button) findViewById(R.id.update_btn);
		update_btn.setOnClickListener(this);
		about_btn = (Button) findViewById(R.id.about_btn);
		about_btn.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.account_manager_btn:
			intent.setClass(ApplicationSetActivity.this, AddAcountActivity.class);
			startActivity(intent);
			break;
		case R.id.suggestion_btn:
			break;
		case R.id.update_btn:
			break;
		case R.id.about_btn:
			new AlertDialog.Builder(this).setMessage(Html.fromHtml(getResources().getString(R.string.about_msg)))
					.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
						@Override
						public void onClick(DialogInterface dialog, int which) {
							dialog.dismiss();
						}
					}).setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
						@Override
						public void onClick(DialogInterface dialog, int which) {
							dialog.dismiss();
						}
					}).create().show();
			break;
		}
	}
}
